Send feedback on this topic.
Teradata.Client.Provider
TdNumber Constructor(Int32[],Int16)



Teradata.Client.Provider Namespace > TdNumber Structure > TdNumber Constructor : TdNumber Constructor(Int32[],Int16)
The array that contains the components of the number.
The exponent of the Floating decimal.
Initializes a new instance of TdNumber from an array of Int32 that represents the data components that defines the number.
Syntax
'Declaration
 
Public Function New( _
   ByVal input() As Integer, _
   ByVal exponent As Short _
)
'Usage
 
Dim input() As Integer
Dim exponent As Short
 
Dim instance As New TdNumber(input, exponent)
public TdNumber( 
   int[] input,
   short exponent
)
public:
TdNumber( 
   array<int>^ input,
   short exponent
)

Parameters

input
The array that contains the components of the number.
exponent
The exponent of the Floating decimal.
Exceptions
ExceptionDescription
The array must contain 5 components.
The number of digits in the mantissa cannot exceed 40, or the exponent is not between -130 and 125.
Remarks

The input represents the mantissa of the number. When the components of the mantissa are determined, the mantissa must be converted into a scaled integer, and the exponent must be adjusted. The array must contain 5 elements. The order of the components in the array must start from the least to the most significant.

When a number is normalized, the exponent can range from -130 to 125. However, the mantissa must be represented as scaled integer. There the range of exponent is -169 to 86.

The following is an example of setting up the array that represents the mantissa of the number, and then invoking this constructor:

// Number: 90874.7443315867e+50 // // To generate the array, the scaled integer representation of the mantissa must be taken: 908747443315867. // The Hex Representation of the scaled integer is: 00000000 00000000 00000000 00033A80 408CA49B // // The exponent has to be adjusted to account for the scaled integer. In this case the exponent // will be "e+40". // // The components in the array start with the least significant component(0x408CA49B). Int32 [] data1 = {0x408CA49B0, 0x00033A80, 0, 0, 0}; TdNumber number1 = new TdNumber(data1, 40); // Number: -930573624643332.32552e-65 // Hex Representation of Scaled Integer: FFFFFFFF FFFFFFFF FFFFFFFA F491D5E0 B2A60658 // Adjusted Exponent: -70 Int32 [] data2 = {unchecked((Int32)0xB2A60658), unchecked((Int32)0xF491D5E0), unchecked((Int32)0xFFFFFFFA), unchecked((Int32)0xFFFFFFFF), unchecked((Int32)0xFFFFFFFF)}; TdNumber value2 = new TdNumber(data2, -70);
Requirements

Target Platforms: Windows 8.1, Windows 10, Windows Server 2012 R2, Windows Server 2016, Windows Server 2019

See Also

Reference

TdNumber Structure
TdNumber Members
Overload List